using System;
using WCSFContrib.PageFlow;
using PageFlowWithShoppingCartQuickstart.Store.BusinessLogic;
using Page=System.Web.UI.Page;

public partial class Default : Page
{
	protected void Page_Load(object sender, EventArgs e)
	{
		if (!IsPostBack)
		{
			if (Controller.HasPageFlowInstanceSuspended())
			{
				processStartMultiview.SetActiveView(resumePreviousView);
			}
			else
			{
				processStartMultiview.SetActiveView(startNewView);
			}
		}
	}

	protected void startButton_Click(object sender, EventArgs e)
	{
		Controller.StartNewProcess();
	}

	public StoreController Controller
	{
		get { return new StoreController(PageFlowDirectory.Provider); }
	}

	protected void resumeButton_Click(object sender, EventArgs e)
	{
		Controller.ResumeShopping();
	}

	protected void startOverButton_Click(object sender, EventArgs e)
	{
		Controller.RestartShopping();
	}
}